<template>
  <div>
    <swiper>
      <swiper-item v-for="item in banner">
        <a :href="item.link">
          <img :src="item.image" @load="itemLoad">
        </a>
      </swiper-item>
    </swiper>
  </div>
</template>

<script>
import {Swiper, SwiperItem} from "components/common/swiper/index"


export default {
  name: "HomeSwiper",
  props:{
    banner:{
      type:Array,
      default(){
        return []
      }
    }
  },data(){
    return{
      isLoad:true
    }
  },
  components: {
    SwiperItem,
    Swiper
  },
  methods:{
    itemLoad(){
     if (this.isLoad){
       this.$emit("itemLoad")
       this.isLoad=false
     }
    }
  }
}
</script>

<style scoped>

</style>